#!/bin/bash

cd $(dirname $0)

# 官方获取docker
curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun

# 配置镜像加速器
mkdir -p /etc/docker /data/docker
tee /etc/docker/daemon.json << EOF
{
    "registry-mirrors": ["http://hub-mirror.c.163.com"],
    "data-root": "/data/docker"
}
EOF

# 启动docker
systemctl restart docker
systemctl enable docker

# 安装docker-compose
# nohup curl -L https://github.com/docker/compose/releases/download/1.27.0/docker-compose-`uname -s`-`uname -m` /usr/local/bin/docker-compose > /dev/null 2>&1 &
cp -r ../resource/docker-compose/docker-compose-Linux-x86_64 /usr/local/bin/docker-compose && chmod +x /usr/local/bin/docker-compose

